This application is based on an application No. 10-217020 filed in Japan, the contents of which are hereby incorporated by reference.
The present invention relates to compression of image data.
Various encoding techniques are used for multi-level image data received from an image reader such as a scanner. For example, JPEG (Joint Photographic Experts Group) using discrete cosine transform is a representative technique of variable-length coding of a still image, and it has an advantage of a high compression rate. However, JPEG has problems. For example, it needs a large-scale circuit and its process speed is lowered for the discrete cosine transform. Data processing is also not possible on the compressed data.
On the other hand, block truncation coding for multi-level image data is a fixed-length coding technique. In block truncation coding, pixels are divided into blocks consisting of a plurality of adjacent pixels. By using a characteristic that data of the pixels in a block are similar to each other, a smaller number of gradation levels than that of the original image is assigned. That is, average information and gradation distribution information of the multi-level image data are calculated, and the original image data is quantized at the smaller number of gradation levels based on the average and the gradation distribution of the multi-level image data. The obtained data on the average and the gradation width of a block, and the code data of each pixel therein are used as encoded data of the block.
The block truncation coding has a problem that compression ratio is small. For example, it is 3/8 for a block of 4*4 pixels. Then, it is proposed to increase the compression ratio further. For example, when the gradation width information is zero, a number of continuous blocks having the gradation width information of zero is counted, and the average information and the count are stored (Japanese Patent laid open Publication 6-334870). However, this technique has a bad compression ratio because compression is impossible when the average information is different in a number of continuous blocks even if the gradation width information thereof is zero.
On the other hand, it is also a problem that if a document including a photograph portion is compressed at a high compression ratio, the image obtained by decoding has low image quality on the photograph portion. Thus, a high compression ratio is not desirable when the quality of an image obtained by encoding is important. Therefore, an image encoder has to take image quality into account.
The present invention provides an image processor which compresses data appropriately by taking features of the image to be compressed into account.
The present invention also provides an image processor which compresses data appropriately by taking the image quality into account.
In one embodiment of the invention, in an image encoder, a first compression section compresses the image data, divided to a plurality of blocks having a predetermined size, in the unit of block. Further, an attribute decider decides an attribute of the image data for each block, and a document type decider decides a type of the image including a block to be processed. Then, a second compression section compresses further compresses image data according to the attribute of each block and the document type.
In a second embodiment of the invention, in an image encoder, a first compression section compresses the image data, divided to a plurality of blocks having a predetermined size, in the unit of block. An attribute decider decides an attribute of the image data for each block, and a second compression section compresses further the compressed image data according to the attribute of each block.
In a third embodiment of the invention, in an image encoder, a first compression section compresses the image data, divided to a plurality of blocks having a predetermined size, in the unit of block. On the other hand, a compression ratio is received at an input section. Then, a second compression section compresses further the compressed data at the compression ratio.
An advantage of the present invention is that the image data are compressed appropriately in the unit of block of a plurality of pixels according to the attribute of the image and the document type.
Another advantage of the present invention is that the image data can be compressed in the unit of block appropriately according to the attribute of block.
A further advantage of the present invention is that the image data can be compressed secondarily according to a compression ratio by taking the type of image into account.